#ifndef WIDGET_H_
#define WIDGET_H_

class Widget
{
public:
	virtual ~Widget(void);

protected:
	Widget(void);

public:
	// This is the template method
	// which define the main work flow.
	// Concrete class would override the sub method
	// to implentment in its own way.
	void display();

protected:
	virtual void preDisplay() = 0;
	virtual void doDisplay() = 0;
	virtual void postDisplay() = 0;
};

class Line : public Widget
{
protected:
	void preDisplay();
	void doDisplay();
	void postDisplay();
};

class Rectangle : public Widget
{
protected:
	void preDisplay();
	void doDisplay();
	void postDisplay();
};

#endif // WIDGET_H_
